Week 2

Excercise 2

In this excercise we will manually fit a linear regression model to given data

The data seems to follow a linear trend, thus linear regression model would be a good aproximation for predicting the data

We will first implement it by hand, and then with a built in function

The cost function is decreasing with each itteration as expected

Numpy fit

Same as polyfit

The best fit predicted red line

Path of gradient descent given starting point (-4,-4)

Excercise 3

Linear regression with multiple variables

We need to standardize the data

Gradient discent approach

Matrix Multiplication minimization point finding apporach

Sckikit linear model approach